﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.Composition;
using Core.Common;
using Core.Interfaces;
using Core.DataAccess;
using Core.DataAccess.IRepositories;
using Core.BusinessLogic.Interfaces;

namespace Core.BusinessLogic
{
    [Export(typeof(IBlogService))]
    public class BlogService : IBlogService
    {
        [Import]
        private IBlogRepository _blogRepository;

        public BlogService()
        {
            MEFManager.Compose(this);
        }

        public void SaveBlog(Blog blog)
        {
            _blogRepository.SaveBlog(blog);
        }

        public List<Blog> GetBlogListByAccountID(Int32 accountID)
        {
            return _blogRepository.GetBlogListByAccountID(accountID);
        }

        public List<Blog> GetBlogListBySubject(string subject)
        {
            return _blogRepository.GetBlogListBySubject(subject);
        }

        public Blog GetBlogByBlogID(Int32 blogID)
        {
            return _blogRepository.GetBlogByBlogID(blogID);
        }
    }
}
